﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.TestDrivens;

namespace Pixysoft.Framework.Noebe.Orm.testdriven
{
    [TestDriven]
    class testdriven
    {
        //stack
        [TestCase]
        public static void test()
        {
            string base2value = "StringValue";
            string base2object = "OrmObject";
            string base2object_2value = "OrmObject.StringValue";
            string base2object_2object = "OrmObject.OrmObject";
            string base2object_2valuecollection = "OrmObject.StringList";

            string base2object_2objectcollection_2object = "OrmObject.OrmList.OrmObject";
            string base2objectcollection_2objectcollection_2object = "OrmList.OrmList.OrmObject";
            string base2objectcollection_2valuecollection = "OrmList.StringList";
            string base2valuecollection = "StringList";

            Assert.SaveOrVerify("base2value", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateStack(typeof(Person), base2value)));
            Assert.SaveOrVerify("base2object", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateStack(typeof(Person), base2object)));
            Assert.SaveOrVerify("base2object_2value", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateStack(typeof(Person), base2object_2value)));
            Assert.SaveOrVerify("base2object_2object", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateStack(typeof(Person), base2object_2object)));
            Assert.SaveOrVerify("base2object_2valuecollection", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateStack(typeof(Person), base2object_2valuecollection)));

            Assert.SaveOrVerify("base2object_2objectcollection_2object", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateStack(typeof(Person), base2object_2objectcollection_2object)));
            Assert.SaveOrVerify("base2objectcollection_2objectcollection_2object", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateStack(typeof(Person), base2objectcollection_2objectcollection_2object)));
            Assert.SaveOrVerify("base2objectcollection_2valuecollection", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateStack(typeof(Person), base2objectcollection_2valuecollection)));
            Assert.SaveOrVerify("base2valuecollection", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateStack(typeof(Person), base2valuecollection)));
        }

        //queue
        public void test2()
        {
            string base2value = "StringValue";
            string base2object = "OrmObject";
            string base2object_2value = "OrmObject.StringValue";
            string base2object_2object = "OrmObject.OrmObject";
            string base2object_2valuecollection = "OrmObject.StringList";

            string base2object_2objectcollection_2object = "OrmObject.OrmList.OrmObject";
            string base2objectcollection_2objectcollection_2object = "OrmList.OrmList.OrmObject";
            string base2objectcollection_2valuecollection = "OrmList.StringList";
            string base2valuecollection = "StringList";

            Assert.SaveOrVerify("base2value", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateQueue(typeof(Person), base2value)));
            Assert.SaveOrVerify("base2object", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateQueue(typeof(Person), base2object)));
            Assert.SaveOrVerify("base2object_2value", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateQueue(typeof(Person), base2object_2value)));
            Assert.SaveOrVerify("base2object_2object", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateQueue(typeof(Person), base2object_2object)));
            Assert.SaveOrVerify("base2object_2valuecollection", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateQueue(typeof(Person), base2object_2valuecollection)));

            Assert.SaveOrVerify("base2object_2objectcollection_2object", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateQueue(typeof(Person), base2object_2objectcollection_2object)));
            Assert.SaveOrVerify("base2objectcollection_2objectcollection_2object", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateQueue(typeof(Person), base2objectcollection_2objectcollection_2object)));
            Assert.SaveOrVerify("base2objectcollection_2valuecollection", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateQueue(typeof(Person), base2objectcollection_2valuecollection)));
            Assert.SaveOrVerify("base2valuecollection", OrmQueryStructureFactory.DumpToString(OrmQueryStructureFactory.CreateQueue(typeof(Person), base2valuecollection)));

        }
    }
}
